package com.kaishengit.dao;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.kaishengit.pojo.Goal;
import com.kaishengit.pojo.Project;

@Repository
public class GoalDao extends BaseDao<Goal,Integer>{

	@SuppressWarnings("unchecked")
	public List<Goal> findByProject(Project project) {
		Query query = getSession().createQuery("from Goal where project=:project order by createtime desc");
		query.setParameter("project", project);
		return query.list();
	}

}
